﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Xml.Serialization;

namespace Crawler
{
    #region File Class
    [Serializable]
    public class File
    {
        #region Properties
        [XmlAttribute("u")]
        public string Url { get; set;}

        [XmlAttribute("t")]
        public string Title { get; set; }

        [XmlAttribute("d")]
        public string Description { get; set; }

        [XmlAttribute("cd")]
        public DateTime CrawledDate { get; set; }

        [XmlAttribute("s")]
        public long Size { get; set; }

        [XmlAttribute("h")]
        public long Hits { get; set; }
        #endregion

        #region Constructors
        public File() { }

        public File(File file)
        {
            this.Title = file.Title;
            this.Description = file.Description;
            this.CrawledDate = file.CrawledDate;
            this.Url = file.Url;
            this.Size = file.Size;
            this.Hits = file.Hits;
        }

        public File(string url, string title, string description, DateTime datecrawl, long length)
        {
            this.Title = title;
            this.Description = description;
            this.CrawledDate = datecrawl;
            this.Url = url;
            this.Size = length;
        }
        #endregion
    }
    #endregion
}
